package com.hei.controller;

import com.hei.service.BkindService;
import com.hei.service.BlabelService;
import com.hei.util.ResponseMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
public class headController {

    @Autowired
    private BkindService bkindService;

    @Autowired
    private BlabelService blabelService;

    @RequestMapping("/toAbout")
    public String toAbout(){
        return "about";
    }
    @RequestMapping("/toLogin")
    public String toLogin(){
        return "login";
    }
    @RequestMapping("/toRegister")
    public String toRegister(){
        return "register";
    }

    @RequestMapping("/firstid")
    @ResponseBody
    public ResponseMessage firstId(){
        String kind = bkindService.selectFirstId();
        String label=blabelService.selectFirstId();
        return ResponseMessage.success(200,"成功").addObject("kind",kind).addObject("label",label);
    }
}
